package com.feature50.makeover.ui;

import com.feature50.makeover.utils.ImageUtils;

import javax.swing.*;
import javax.swing.plaf.basic.BasicArrowButton;
import javax.swing.plaf.metal.MetalScrollButton;
import java.awt.*;

public class CandylandScrollButton extends MetalScrollButton {
    private static Icon BUTTON_WEST;
    private static Icon BUTTON_EAST;
    private static Icon BUTTON_NORTH;
    private static Icon BUTTON_SOUTH;
    static {
        BUTTON_WEST = ImageUtils.getIcon("scrollbar-button-west.png");
        BUTTON_EAST = ImageUtils.getIcon("scrollbar-button-east.png");
        BUTTON_NORTH = ImageUtils.getIcon("scrollbar-button-north.png");
        BUTTON_SOUTH = ImageUtils.getIcon("scrollbar-button-south.png");
    }

    CandylandScrollButton(int direction, int width, boolean freeStanding) {
        super(direction, width, freeStanding);
        setOpaque(false);
    }

    @Override
    public Dimension getMaximumSize() {
        return this.getPreferredSize();
    }

    @Override
    public Dimension getMinimumSize() {
        return this.getPreferredSize();
    }

    @Override
    public Dimension getPreferredSize() {
        return new Dimension(0, 0);
    }

    @Override
    public void paint(Graphics g) {
        switch (getDirection()) {
            case BasicArrowButton.WEST:
                //BUTTON_WEST.paintIcon(null, g, 0, 0);
                break;
            case BasicArrowButton.EAST:
                //BUTTON_EAST.paintIcon(null, g, 0, 0);
                break;
            case BasicArrowButton.NORTH:
                //BUTTON_NORTH.paintIcon(null, g, 0, 0);
                break;
            case BasicArrowButton.SOUTH:
                //BUTTON_SOUTH.paintIcon(null, g, 0, 0);
                break;
        }
    }
}
